<template>
	<div class="mt-4">
		<Editor v-model="content" />
		<div class="mt-4">
			<el-button type="primary" @click="onSubmit">{{ $t('public.ok') }}</el-button>
			<el-button @click="onCancel">{{ $t('public.cancel') }}</el-button>
		</div>

	</div>
</template>

<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
const { t: $t } = useI18n()
import Editor from "@/components/Editor/index.vue"
let emit = defineEmits(['infoData'])
let content = '<b>485</b>'
let config = reactive({
	config_name: 'userAgreement',
	config_content: '',
	config_switch: 1,
	csr_id: 0
})

// 保存
let onSubmit = () => {
	let data = {
		config_name: config.config_name,
		config_content: JSON.stringify(content),
		config_switch: config.config_switch,
		csr_id: config.csr_id
	}
	emit('infoData', data)
}

// 取消
let onCancel = () => {
	console.log(content)
}

</script>
